package cn.edu.zafu.bigdata.zqt.Error;

public class zero {
    public static void main(String[] args) {
        try {
            int result=divide(10, 0);
            System.out.println(result);
        } catch (Exception e) {
            System.out.println("错误："+e.getMessage());
        }
    }
    public static int divide(int a, int b) throws Exception {
        if (b == 0) {
            throw new Exception("除数不能为0");
        }
        return a / b;
    }
}
